<#assign shmsConstant = statics["cn.hfatec.shms.constants.ShmsConstant"]/>
<!DOCTYPE html>
<html>
<head>
    <title>家康运营管理系统-
        <sitemesh:write property="title"/>
    </title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta charset="UTF-8"/>
    <link rel="icon" type="image/ico" href="${absoluteContextPath}/images/favicon.ico"/>
    <!-- Bootstrap -->
    <link href="${absoluteContextPath}/css/bootstrap.min.css" rel="stylesheet">
    <link href="${absoluteContextPath}/font-awesome/4.1.0/css/font-awesome.min.css" rel="stylesheet">
    <link rel="stylesheet" href="${absoluteContextPath}/js/nestable/css/style.css">
    <link rel="stylesheet" href="${absoluteContextPath}/css/chosen.min.css">
    <link rel="stylesheet" href="${absoluteContextPath}/css/chosen-bootstrap.css">
    <link href="${absoluteContextPath}/css/minoral.css" rel="stylesheet">
    <link href="${absoluteContextPath}/css/bootstrap-select.css" rel="stylesheet">
    <link href="${absoluteContextPath}/css/fullcalendar.css" rel="stylesheet">
    <!-- JS -->
    <script src="${absoluteContextPath}/js/jquery.js"></script>
    <script src="${absoluteContextPath}/js/jquery-migrate-1.2.1.js"></script>
    <script src="${absoluteContextPath}/js/jquery-ui.js"></script>
    <script src="${absoluteContextPath}/js/bootstrap.min.js"></script>
    <script src="${absoluteContextPath}/js/jquery.nicescroll.min.js"></script>
    <script src="${absoluteContextPath}/js/chosen.jquery.js"></script>
    <script src="${absoluteContextPath}/js/minoral.min.js"></script>
    <script src="${absoluteContextPath}/js/jquery.form.js"></script>
    <script src="${absoluteContextPath}/js/jquery.json-2.4.min.js"></script>
    <script src="${absoluteContextPath}/js/nestable/jquery.nestable.js"></script>
    <script type="text/javascript" src="${absoluteContextPath}/js/My97DatePicker/WdatePicker.js"></script>
    <script src="${absoluteContextPath}/js/bootstrap-select.js"></script>
    <script src="${absoluteContextPath}/js/moment.min.js"></script>
    <script src="${absoluteContextPath}/js/fullcalendar.js"></script>
    <script src="${absoluteContextPath}/js/lang-all.js"></script>
    <script src="${absoluteContextPath}/js/jquery.smartWizard-2.0.min.js"></script>
    <script src="${absoluteContextPath}/js/common.js"></script>

    <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
    <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
    <!--[if lt IE 8]>
    <script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
    <script src="https://oss.maxcdn.com/libs/respond.js/1.3.0/respond.min.js"></script>
    <![endif]-->
    <sitemesh:write property="head"/>
</head>
<body class="brownish-scheme">
<!-- Wrap all page content here -->
<div id="wrap">
    <!-- Make page fluid -->
    <div class="row">
        <!-- Fixed navbar -->
        <div class="navbar navbar-default navbar-fixed-top" role="navigation">
            <!-- Branding -->
            <div class="navbar-header col-md-2">
                <img src="${absoluteContextPath}/images/logo.png">
                <img src="${absoluteContextPath}/images/top-img.png" style="margin-left:10px;">
            </div>
            <!-- Branding end -->
            <!-- .nav-collapse -->
            <div class="navbar-collapse">
                <!-- Content collapsing at 768px to sidebar -->
                <div class="collapsing-content nav-top">
                    <!-- User Controls -->
                    <div class="user-controls">
                        <ul>
                            <li class="dropdown messages" id="news">
                            <#include "../system/notice/news.ftl"/>
                            </li>
                            <li class="dropdown messages">
                                <div class="profile-photo">
                                    <img src="${absoluteContextPath}/images/profile-photo.png" alt/>
                                </div>
                                <span class="margin-left-5"><#if Session['loginUser']??>${Session['loginUser'].userName}</#if></span>
                            </li>
                            <li class="dropdown settings">
                                <a class="dropdown-toggle options" data-toggle="dropdown" href="#">
                                    <i class="fa fa-angle-down"></i>
                                </a>
                                <ul class="dropdown-menu arrow">
                                    <li>
                                        <a href="#" onclick="goModifyPassword();"><i class="fa fa-file-text"></i><span
                                                class="margin-left-5">密码修改</span></a>
                                    </li>
                                    <li>
                                        <a href="${absoluteContextPath}/logout"><i class="fa fa-power-off"></i><span
                                                class="margin-left-5">退出</span></a>
                                    </li>
                                </ul>
                            </li>
                        </ul>
                    </div>
                    <!-- User Controls end -->
                </div>
                <!-- /Content collapsing at 768px to sidebar -->
            <#include "rx_left.ftl" />
            </div>
            <!--/.nav-collapse -->
        </div>
        <!-- Fixed navbar end -->
        <!-- Page content -->
        <div class="mask">
            <div id="loader"></div>
        </div>
        <div id="content" class="content-two" style="overflow: hidden; outline: none; padding-left: 40px;"
             tabindex="5000">
            <div id="rxContentLeft" style="padding:0; float: left">
                <div class="navbar">
                    <ul class="nav navbar-nav side-nav side-nav-two">
                        <li class="dropdown">
                        <#--<input class="form-control" value="${custom.customName!''}" type="text"/>-->
                            <input id="auditCustomId" class="form-control" value="${customId!''}" type="hidden"/>
                            <input id="auditPlanId" class="form-control" value="${planId!''}" type="hidden"/>
                        <#--<input class="form-control" name="auditPlanId" id="auditPlanId" value="${auditPlanId!''}" type="button">-->
                        </li>
                        <li id="customInfo">
                            <a url="${absoluteContextPath}/flowManage/audit/basic/list/${customId!''}"
                               class="dropdown-toggle" title="" data-original-title="基本信息">基本信息</a>
                        </li>
                        <li id="question">
                            <a url="${absoluteContextPath}/flowManage/audit/customAnswer/list/${customId!''}/${planId!''}"
                               class="dropdown-toggle" title="" data-original-title="问卷调查">问卷调查</a>
                        </li>
                        <li id="indexQuery">
                            <a url="${absoluteContextPath}/flowManage/audit/indexValue/list/${customId!''}/${planId!''}"
                               class="dropdown-toggle" title="" data-original-title="指标查询">指标查询</a>
                        </li>
                    <#if assessList?? && (assessList?size>0)>
                        <li id="assess">
                            <a url="${absoluteContextPath}/flowManage/audit/assess/${customId!''}"
                               class="dropdown-toggle"
                               title="" data-original-title="体态评估">体态评估</a>
                        </li>
                    </#if>
                        <li id="riskReport">
                            <a url="${absoluteContextPath}/flowManage/audit/riskReport/list/${customId!''}/${planId!''}"
                               class="dropdown-toggle" title="" data-original-title="风险报告">风险报告</a>
                        </li>
                        <li id="sportPlan">
                            <a url="${absoluteContextPath}/flowManage/audit/planView/${planId!''}"
                               class="dropdown-toggle"
                               title="" data-original-title="运动计划">运动计划</a>
                        </li>
                    </ul>
                </div>
            </div>
            <div id="rxContent" class="col-md-10" style="padding: 0px 0px; float: right">
                <sitemesh:write property="body"/>
            </div>
            <div class="modal fade" id="confirmModal" tabindex="-1" role="dialog" aria-labelledby="cardCode04"
                 aria-hidden="true">
                <div class="modal-dialog" style="width: 400px;">
                    <div class="modal-content">
                        <div class="modal-body">
                            <div class="text-center modal-tip">
                                <strong id="confirmModalTitle"> 是否删除选中的内容吗？</strong>

                                <p id="confirmModalContent"> 如果是请点击确定按钮，否则请点击取消。</p>

                                <p>
                                    <input name="" type="button" class="btn  btn-primary sure" value="确定">&nbsp;
                                    <input name="" type="button" class="btn  btn-default" value="取消"
                                           data-dismiss="modal">
                                </p>
                            </div>
                        </div>
                    </div>
                </div>
            </div>

            <div class="modal fade modal-error" id="alertModal" tabindex="-1" role="dialog" aria-labelledby="otherCode"
                 aria-hidden="true">
                <div class="modal-dialog modal-dialog-sm">
                    <div class="modal-content">
                        <div class="modal-body">

                            <p class="login-error">
                                <i class="fa fa-exclamation-triangle"></i><span id="alterContent">登录用户不存在，或者未激活!</span>
                                <button type="button" class="login-error-close" data-dismiss="modal"
                                        aria-hidden="true"></button>
                            </p>
                        </div>
                    </div>
                    <!-- /.modal-content -->
                </div>
                <!-- /.modal-dialog -->
            </div>

            <div class="modal fade" id="modifyPasswordModal" tabindex="-1" role="dialog" aria-labelledby="cardCode04"
                 aria-hidden="true">
                <div class="modal-dialog wide" style="width: 400px;">
                    <div class="modal-content">
                        <div class="modal-header">
                            <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                            <h4 class="modal-title" id="myModalLabel">密码修改</h4>
                        </div>
                        <div class="modal-body">
                            <div id="errorMessage"><#include "../message.ftl" /></div>
                            <form class="form-horizontal" role="form" id="modifyPasswordForm" method="post"
                                  action="${absoluteContextPath}/system/user/modifyPassword">
                                <div class="row">
                                    <div class="form-group col-md-12">
                                        <label class="col-sm-4 control-label">原始密码<sup
                                                style="color: red">*</sup></label>

                                        <div class="col-sm-8">
                                            <input name="password" value="" type="password" class="form-control"/>
                                        </div>
                                    </div>
                                    <div class="form-group col-md-12">
                                        <label class="col-sm-4 control-label">新密码<sup style="color: red">*</sup></label>

                                        <div class="col-sm-8">
                                            <input name="password1" value="" type="password" class="form-control"/>
                                        </div>
                                    </div>
                                    <div class="form-group col-md-12">
                                        <label class="col-sm-4 control-label">重复密码<sup
                                                style="color: red">*</sup></label>

                                        <div class="col-sm-8">
                                            <input name="password2" type="password" class="form-control"/>
                                        </div>
                                    </div>
                                </div>
                            </form>
                        </div>
                        <div class="modal-footer">
                            <button type="button" class="btn btn-default" data-dismiss="modal" aria-hidden="true">关闭
                            </button>
                            <button type="button" class="btn btn-primary" onclick="modifyPassword();">保存</button>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <!-- Page content end -->
    </div>
    <!-- Make page fluid-->
</div>
<script type="text/javascript">
$(function () {
    $(".chosen-select").chosen({disable_search_threshold: 10});
    $('table tr td a').tooltip({'placement': 'top', 'container': 'body'});
    $('.dd3-content .controls a').tooltip({'placement': 'top', 'container': 'body'});
    $(".dropdown-menu").click(function (e) {
        e.stopPropagation();
    });

    $("#rxContent").width(window.screen.width - $("#rxContentLeft").width() - 250 - 17);

    $(window).resize(function () {
        $("#content").getNiceScroll().resize();
        $("#rxContent").width(window.screen.width - $("#rxContentLeft").width() - 250 - 17);
    });

});

$("#customInfo").click(function () {
    var url = $(this).find("a").attr("url");
    $.ajax({
        url: url,
        type: 'post',
        success: function (data) {
            var data = JSON.parse(data);
            console.info(data);
            if (data.returnCode == 1) {
                $("#rxContent").html(data.content.data);
                $("#customInfo").addClass("open");
                $("#question").removeClass("open");
                $("#indexQuery").removeClass("open");
                $("#assess").removeClass("open");
                $("#riskReport").removeClass("open");
                $("#sportPlan").removeClass("open");
            } else {
                $.showMessage({parentId: "showMessage", message: "数据加载异常！", type: "success"});
            }
        }
    });
});
$("#question").click(function () {
    var url = $(this).find("a").attr("url");
    $.ajax({
        url: url,
        type: 'post',
        success: function (data) {
            var data = JSON.parse(data);
            if (data.returnCode == 1) {
                $("#rxContent").html(data.content.data);
                $("#customInfo").removeClass("open");
                $("#question").addClass("open");
                $("#indexQuery").removeClass("open");
                $("#assess").removeClass("open");
                $("#riskReport").removeClass("open");
                $("#sportPlan").removeClass("open");
            } else {
                $.showMessage({parentId: "showMessage", message: "数据加载异常！", type: "success"});
            }
        }
    });
});
$("#indexQuery").click(function () {
    var url = $(this).find("a").attr("url");
    console.info(url);
    $.ajax({
        url: url,
        type: 'post',
        success: function (data) {
            var data = JSON.parse(data);
            if (data.returnCode == 1) {
                $("#rxContent").html(data.content.data);
                $("#customInfo").removeClass("open");
                $("#question").removeClass("open");
                $("#assess").removeClass("open");
                $("#riskReport").removeClass("open");
                $("#sportPlan").removeClass("open");
                $("#indexQuery").addClass("open");
            } else {
                $.showMessage({parentId: "showMessage", message: "数据加载异常！", type: "success"});
            }
        }
    });
});
$("#assess").click(function () {
    $("#rxContentDiv").niceScroll().remove();
    var url = $(this).find("a").attr("url");
    $.ajax({
        url: url,
        type: 'post',
        success: function (data) {
            var data = JSON.parse(data);
            if (data.returnCode == 1) {
                $("#rxContent").html(data.content.data);
                $("#customInfo").removeClass("open");
                $("#question").removeClass("open");
                $("#indexQuery").removeClass("open");
                $("#assess").addClass("open");
                $("#riskReport").removeClass("open");
                $("#sportPlan").removeClass("open");
            } else {
                $.showMessage({parentId: "showMessage", message: "数据加载异常！", type: "success"});
            }
        }
    });
});
$("#riskReport").click(function () {
    var url = $(this).find("a").attr("url");
    console.info(url);
    $.ajax({
        url: url,
        type: 'post',
        success: function (data) {
            var data = JSON.parse(data);
            if (data.returnCode == 1) {
                $("#rxContent").html(data.content.data);
                $("#customInfo").removeClass("open");
                $("#question").removeClass("open");
                $("#indexQuery").removeClass("open");
                $("#assess").removeClass("open");
                $("#riskReport").addClass("open");
                $("#sportPlan").removeClass("open");
            } else {
                $.showMessage({parentId: "showMessage", message: "数据加载异常！", type: "success"});
            }
        }
    });
});
$("#sportPlan").click(function () {
    var url = $(this).find("a").attr("url");
    $.ajax({
        url: url,
        type: 'post',
        success: function (data) {
            var data = JSON.parse(data);
            if (data.returnCode == 1) {
                $("#rxContent").html(data.content.data);
                $("#customInfo").removeClass("open");
                $("#question").removeClass("open");
                $("#indexQuery").removeClass("open");
                $("#assess").removeClass("open");
                $("#riskReport").removeClass("open");
                $("#sportPlan").addClass("open");
            } else {
                $.showMessage({parentId: "showMessage", message: "数据加载异常！", type: "success"});
            }
        }
    });
});
function goModifyPassword() {
    $("#modifyPasswordModal").modal("show");
    $("#modifyPasswordForm")[0].reset();
}

function modifyPassword() {
    $("#" + "modifyPasswordForm").ajaxSubmit({
        success: function (data) {
            data = JSON.parse(data);
            if (data.returnCode == 1) {
                $("#modifyPasswordForm")[0].reset();
                $.showMessage({parentId: "errorMessage", message: "密码修改成功！", type: "success"});
            } else {
                $.showMessage({parentId: "errorMessage", message: "<strong>错误信息</strong>：" + data.returnMsg, type: "error"});
            }
        }
    });
}

/*系统消息点击事件*/
function readNews(id) {
    var data = {};
    var url = '${absoluteContextPath}/system/notice';
    if (id != undefined) {
        data.id = id;
        url = url + "/goNotice";
    }
    $.ajax({
        url: url,
        type: 'post',
        data: data,
        success: function (data) {
            var data = JSON.parse(data);
            if (data.returnCode == 1) {
                var pop_div = $('#confirmModal1');
                pop_div.html(data.content.data);
                pop_div.modal('show');
                $(pop_div).find("#confirm").click(function () {
                    $.post("${absoluteContextPath}/system/notice/goReader", {
                        'id': id
                    }, function (data) {
                        data = JSON.parse(data);
                        if (data.returnCode == 1) {
                            refreshNewsTable();
                        }
                    });
                    $("#confirmModal1").modal("hide");
                });
            } else {
                $.showMessage({parentId: "showMessage", message: "数据加载异常！", type: "success"});
            }
        }
    });
}

function refreshNewsTable() {
    $.post("${absoluteContextPath}/system/notice/ajaxNewsList",
            function (data) {
                var data = JSON.parse(data);
                if (data.returnCode == 1) {
                    $("#news").html(data.content.data);
                } else {
                    $.showMessage({parentId: "showMessage", message: "表格数据加载异常！", type: "success"});
                }
            });
}
</script>
</body>
</html>

